<template>
  <mt-actionsheet :actions="actions" v-model="sheetVisible" :closeOnClickModal="false">
  </mt-actionsheet>
</template>

<script>
  import {mapGetters} from 'vuex';
  /**
   * App component.
   * @module common/plugins/actionSheet
   * @author ashen
   * @description  actionSheet交互组件，调用方法为：调用state中的setSheetAction(param)方法
   * @example this.$store.dispatch('setSheetAction', [{
            name: '1',
            method: function (result) {
              setFunction(false);
              console.log(result.name);
            }
          }])
   */
  export default {
    data () {
      return {};
    },
    computed: {
      ...mapGetters(['actions']),
      sheetVisible: {
        get: function () {
          return this.$store.state.mintUI.sheetVisible;
        },
        set: function () {
        }
      }
    },
    mounted: function () {
      document.getElementsByClassName('mint-actionsheet-button')[0].onclick = function () {
        this.$store.dispatch('setSheetVisible', false);
      }.bind(this);
    }
  };
</script>

<style>
</style>
